home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2002 November / CD 1 / APC0211D1.ISO / workshop / prog / files / ActivePerl-5.6.1.633-MSWin32.msi / _9bbca82538c1964578c587a898dcfa13 < prev    next >
Encoding:
Text File  |  2001-10-17  |  491 b   |  24 lines

  1. package URI::file::FAT;
  2.  
  3. require URI::file::Win32;
  4. @ISA=qw(URI::file::Win32);
  5.  
  6. sub fix_path
  7. {
  8.     shift; # class
  9.     for (@_) {
  10.     # turn it into 8.3 names
  11.     my @p = map uc, split(/\./, $_, -1);
  12.     return if @p > 2;     # more than 1 dot is not allowed
  13.     @p = ("") unless @p;  # split bug? (returns nothing when splitting "")
  14.     $_ = substr($p[0], 0, 8);
  15.         if (@p > 1) {
  16.         my $ext = substr($p[1], 0, 3);
  17.         $_ .= ".$ext" if length $ext;
  18.     }
  19.     }
  20.     1;  # ok
  21. }
  22.  
  23. 1;
  24.